IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[cms_sp_DomainAdd]') AND type in (N'P', N'PC'))
	DROP PROCEDURE [dbo].[cms_sp_DomainAdd]
GO
create procedure [dbo].[cms_sp_DomainAdd]
(
@Id int = null output,
@SiteId int,
@Hostname varchar(255),
@CreatedBy int,
@DateCreated datetime,
@LastUpdatedBy int,
@DateLastUpdated datetime
)
as

INSERT INTO [dbo].[Domains]
(
[SiteId],
[Hostname],
[CreatedBy],
[DateCreated],
[LastUpdatedBy],
[DateLastUpdated]
)
VALUES
(
@SiteId,
@Hostname,
@CreatedBy, 
@DateCreated, 
@LastUpdatedBy, 
@DateLastUpdated
)
           
set @Id = SCOPE_IDENTITY()
return @Id

GO

